package com.etc.controller;

import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.etc.entity.AsFollowuser;
import com.etc.service.IAsFollowuserService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 用户关注表Controller
 * 
 * @author ruoyi
 * @date 2022-11-27
 */
@RestController
@RequestMapping("/followuser")
public class AsFollowuserController
{
    @Autowired
    private IAsFollowuserService asFollowuserService;

    /**
     * 查询用户关注表列表
     */

    @GetMapping("/list")
    public List<AsFollowuser> list(AsFollowuser asFollowuser)
    {

        List<AsFollowuser> list = asFollowuserService.selectAsFollowuserList(asFollowuser);
        return list;
    }

    /**
     * 导出用户关注表列表
     */


    @PostMapping("/export")
    public void export(HttpServletResponse response, AsFollowuser asFollowuser) throws IOException {
        List<AsFollowuser> list = asFollowuserService.selectAsFollowuserList(asFollowuser);
        ExcelUtil<AsFollowuser> util = new ExcelUtil<AsFollowuser>(AsFollowuser.class);
        util.exportExcel(response, list, "用户关注表数据");
    }

    /**
     * 获取用户关注表详细信息
     */

    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(asFollowuserService.selectAsFollowuserById(id));
    }

    /**
     * 新增用户关注表
     */


    @PostMapping
    public AjaxResult add(@RequestBody AsFollowuser asFollowuser)
    {
        return AjaxResult.success();
    }

    /**
     * 修改用户关注表
     */


    @PutMapping
    public AjaxResult edit(@RequestBody AsFollowuser asFollowuser)
    {
        return AjaxResult.success();
    }

    /**
     * 删除用户关注表
     */


	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return AjaxResult.success();
    }
}
